﻿<%@ Control Language="C#" Inherits="Shop.Framework.Control.LoginControl" %>
<style type="text/css">
    .login_control_wrapper{
        font-size:10px;
        color:Gray;
        border: solid 2px #7adccf;
        width:150px;
        margin:0 auto;
    }
    
    .login_input_wrapper{
        padding:5px;
    }
    
    .login_label{
        width:42px;
    }
    
    .login_input{
        border: solid 2px #7adccf;
        width:135px;
    }
        
</style>
    <div class="login_control_wrapper">
    
    <div class="login_input_wrapper">
        <img src="/Images/User_16x16_1.png" width="16px" alt="user icon"/>
    </div>
    
    <%if (IsLoggedIn) { %>
        <form action="/logout" method="post">
            <div class="login_input_wrapper">
                <span>Welcome <b><%=CurrentCustomer.FirstName %> <%=CurrentCustomer.LastName %></b></span>
                <br />
                <div class="center">
                    <input type="submit" value="Logout" />                
                </div>
            </div>
        </form>
    <%} else { %>
        <form action="/login" method="post">
            <div class="login_input_wrapper">
                <div class="login_label">Email</div>
                <div>
                    <input type="text" name="username" class="login_input center"/>
                </div>
                <div class="clear"></div>
            </div>
            <div class="login_input_wrapper">
                <div class="login_label">Password</div>
                <div>
                    <input type="password" name="password" class="login_input"/>
                </div>
                <div class="clear"></div>
            </div>
             <div class="center">
                <input type="submit" value="Sign in" class="center"/>
             </div>   
            <br/>
             <div class="center">
                <a href="/register.html" class="center">New Registration</a>   
             </div>
        </form>                        
    <%} %>
        
    </div>